Mini Preview

Brightcells 6 years ago
parent
commit
fb4dffd094

+ 4 - 62
group/group_views.py

@@ -2,10 +2,8 @@
2 2
 
3 3
 from __future__ import division
4 4
 
5
-import itertools
6
-
7 5
 from django.conf import settings
8
-from django.db import connection, transaction
6
+from django.db import transaction
9 7
 from django_curtail_uuid import CurtailUUID
10 8
 from django_logit import logit
11 9
 from django_response import response
@@ -19,8 +17,8 @@ from group.serializers import GroupInfoSerializer, GroupPhotoInfoSerializer, Gro
19 17
 from message.models import UserMessageInfo
20 18
 from utils.error.errno_utils import GroupPhotoStatusCode, GroupStatusCode, GroupUserStatusCode, UserStatusCode
21 19
 from utils.group_photo_utils import get_current_photos
20
+from utils.home_photo_utils import get_home_photos
22 21
 from utils.price_utils import get_group_photo_price
23
-from utils.qiniucdn import qiniu_file_url
24 22
 from utils.redis.connect import r
25 23
 from utils.redis.rgroup import (del_group_photo_thumbup_flag, get_group_info, get_group_photo_comment_list,
26 24
                                 get_group_photo_data, get_group_photo_thumbup_flag, get_group_photo_thumbup_list,
@@ -30,10 +28,7 @@ from utils.redis.rgroup import (del_group_photo_thumbup_flag, get_group_info, ge
30 28
 from utils.redis.rkeys import GROUP_LAST_PHOTO_PK, GROUP_PHOTO_WATCHER_SET, GROUP_USERS_PASSED_SET
31 29
 from utils.redis.rlock import upload_lock
32 30
 from utils.redis.rorder import get_lensman_order_record
33
-from utils.sql.raw import PAI2_HOME_API, PAI2_HOME_WX_API
34 31
 from utils.storage_qiniu_utils import file_save
35
-from utils.time_utils import origin_expired_stamps
36
-from utils.url_utils import share_url
37 32
 
38 33
 
39 34
 @logit
@@ -619,63 +614,10 @@ def thumbup_cancel_api(request):
619 614
 @logit
620 615
 def pai2_home_api(request):
621 616
     """ 首页照片信息 """
622
-    user_id = request.POST.get('user_id', '')
623
-    page = int(request.POST.get('page', 1))
624
-    num = int(request.POST.get('num', settings.PAI2_HOME_PER_PAGE))
625
-
626
-    # 执行原生 SQL 语句,获取首页照片列表
627
-    cursor = connection.cursor()
628
-    cursor.execute((PAI2_HOME_WX_API if request.weixin else PAI2_HOME_API).format(
629
-        user_id=user_id,
630
-        offset=0,
631
-        rows=settings.PAI2_HOME_MAX_ROWS,
632
-    ))
633
-    rows = cursor.fetchall()
634
-
635
-    # 首页照片分页
636
-    rows, left = pagination(rows, page, num)
637
-
638
-    # 首页照片信息
639
-    rows = [{
640
-        'group_id': row[0],
641
-        'group_name': row[1],
642
-        'group_default_avatar': row[2],
643
-        'group_avatar': row[3],
644
-        'group_from': row[4],
645
-        'photo_id': row[5],
646
-        'photo_url': qiniu_file_url(row[6], bucket='watermark' if row[7] else 'photo'),
647
-        'photo_w': row[8],
648
-        'photo_h': row[9],
649
-        'photo_thumbnail_url': qiniu_file_url(row[10], bucket='thumbnail'),
650
-        'photo_thumbnail_w': row[11],
651
-        'photo_thumbnail_h': row[12],
652
-        'photo_thumbnail2_url': qiniu_file_url(row[13], bucket='thumbnail2'),
653
-        'photo_thumbnail2_w': row[14],
654
-        'photo_thumbnail2_h': row[15],
655
-        'photo_share_url': share_url(row[5]),  # Warning: Index of This Line is 5
656
-        'user_id': row[16],
657
-        'nickname': row[17],
658
-        'avatar': row[18],
659
-        'comment_num': row[19],
660
-        'thumbup_num': row[20],
661
-        'photo_from': row[21],
662
-        'session_id': row[22],
663
-        'nomark': row[23],
664
-        'origin': row[24],
665
-        'created_at': row[25],
666
-        'origin_expired_stamps': origin_expired_stamps(row[25], row[16]),
667
-        'thumbup': get_group_photo_thumbup_flag(row[5], user_id),
668
-        'porder': get_lensman_order_record(row[5], user_id) if row[21] == GroupPhotoInfo.SESSION_GROUP else {},
669
-        'display_payment_btn': row[21] == GroupPhotoInfo.SESSION_GROUP and row[27] not in [GroupPhotoInfo.OUTTAKE],
670
-        'longitude': row[28],
671
-        'latitude': row[29],
672
-        'location': row[30],
673
-    } for row in rows]
674
-
675
-    session_photos = map(lambda x: {'session_id': x[0], 'photos': list(x[1])}, itertools.groupby(rows, lambda x: x.get('session_id', '')))
617
+    photos, session_photos, left = get_home_photos(request)
676 618
 
677 619
     return response(200, 'Get Home Data Success', u'获取首页数据成功', {
678
-        'photos': rows,
620
+        'photos': photos,
679 621
         'session_photos': session_photos,
680 622
         'left': left,
681 623
     })

+ 13 - 1
miniapp/mini_views.py

@@ -1,12 +1,24 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-from django.conf import settings
4 3
 from django.db import transaction
5 4
 from django.shortcuts import render
6 5
 from django_logit import logit
7 6
 
7
+from utils.home_photo_utils import get_home_photos
8
+
8 9
 
9 10
 @logit
10 11
 @transaction.atomic
11 12
 def mini_preview(request):
12 13
     return render(request, 'page/mini_preview.html', {})
14
+
15
+
16
+@logit
17
+@transaction.atomic
18
+def mini_preview2(request):
19
+    photos, session_photos, left = get_home_photos(request)
20
+
21
+    return render(request, 'page/mini_preview2.html', {
22
+        'session_photos': session_photos,
23
+        'left': left,
24
+    })

BIN
page/static/img/apple.png


BIN
page/static/img/banana.png


BIN
page/static/img/broccoli.png


BIN
page/static/img/call_guide.png


BIN
page/static/img/carambola.png


BIN
page/static/img/carrot.png


BIN
page/static/img/cherry.png


BIN
page/static/img/comment.png


BIN
page/static/img/corn.png


BIN
page/static/img/dragon.png


BIN
page/static/img/eggplant.png


BIN
page/static/img/fig.png


BIN
page/static/img/grape.png


BIN
page/static/img/img_qrcode_scan.png


BIN
page/static/img/kivi.png


BIN
page/static/img/lemon.png


BIN
page/static/img/mangosteen.png


BIN
page/static/img/no_content_tip.png


BIN
page/static/img/orange.png


BIN
page/static/img/papaya.png


BIN
page/static/img/peach.png


BIN
page/static/img/pineapple.png


BIN
page/static/img/strawberry.png


BIN
page/static/img/thumbup.png


BIN
page/static/img/tomato.png


BIN
page/static/img/watermelon.png


BIN
page/static/img/进入群.png


+ 1047 - 0
page/templates/page/mini_preview2.html

@@ -0,0 +1,1047 @@
1
+{% load staticfiles %}
2
+
3
+<!DOCTYPE html>
4
+<html lang="zh-CN">
5
+<head>
6
+    <meta charset="utf-8">
7
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
+    <meta name="format-detection" content="telephone=no,email=no,address=no">
9
+    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
10
+    <title>图集</title>
11
+
12
+    <link href="//cdn.bootcss.com/photoswipe/4.1.2/photoswipe.css" rel="stylesheet">
13
+    <link href="//cdn.bootcss.com/photoswipe/4.1.2/default-skin/default-skin.css" rel="stylesheet">
14
+
15
+    <style>
16
+        .float-left {
17
+            float: left;
18
+        }
19
+
20
+        .float-right {
21
+            float: right;
22
+        }
23
+
24
+        .clear-both {
25
+            clear: both;
26
+        }
27
+
28
+        .halfscreen {
29
+            width: 49%;
30
+            box-sizing: border-box;
31
+        }
32
+
33
+        .halfscreen > .imgctx > img {
34
+            width: 100% !important;
35
+            box-sizing: border-box;
36
+            outline: 0;
37
+            display: block;
38
+        }
39
+
40
+        .photo-top {
41
+            height: 40px;
42
+            display: flex;
43
+            flex-direction: row;
44
+            align-items: center;
45
+        }
46
+
47
+        .group-avatar {
48
+            box-shadow: 0 0 1px 0 #ccc;
49
+            width: 25px !important;
50
+            height: 25px;
51
+            border-radius: 100%;
52
+            margin-left: 3px;
53
+        }
54
+
55
+        .group-name {
56
+            max-width: 50%;
57
+            height: 25px;
58
+            line-height: 25px;
59
+            text-align: left;
60
+            margin-left: 5px;
61
+            font-size: 12px;
62
+            overflow: hidden;
63
+        }
64
+
65
+        .photo-bottom {
66
+            height: 32px;
67
+        }
68
+
69
+        .section-text {
70
+            line-height: 25px;
71
+            font-size: 12px;
72
+            margin: 0 5px 0 auto;
73
+            color: #999;
74
+        }
75
+
76
+        .section-icon {
77
+            width: 16px;
78
+            height: 16px;
79
+            margin: 3px;
80
+        }
81
+
82
+        .thump-comment-num {
83
+            line-height: 22px;
84
+            font-size: 12px;
85
+            margin-right: 5px;
86
+            color: #999;
87
+        }
88
+
89
+        .mask-thump>img {
90
+            position: absolute;
91
+            right: 10px;
92
+            bottom: 10px;
93
+            width: 30px;
94
+            z-index: 99999;
95
+        }
96
+    </style>
97
+</head>
98
+<body>
99
+<div>
100
+    <div id="photos">
101
+        <div id="left" class="halfscreen" style="float: left;">
102
+{#            <img src="https://placekitten.com/600/400" data-idx="0">#}
103
+{#            <img src="https://placekitten.com/1200/900" data-idx="2">#}
104
+        </div>
105
+        <div id="right" class="halfscreen" style="float: right;">
106
+{#            <img src="https://placekitten.com/1200/900" data-idx="1">#}
107
+{#            <img src="https://placekitten.com/600/400" data-idx="3">#}
108
+        </div>
109
+    </div>
110
+    <div id="mask-thump" class="mask-thump">
111
+        <img class="" src="../../static/img/thumbup.png" />
112
+    </div>
113
+</div>
114
+<!-- Root element of PhotoSwipe. Must have class pswp. -->
115
+<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
116
+    <!-- Background of PhotoSwipe.
117
+         It's a separate element as animating opacity is faster than rgba(). -->
118
+    <div class="pswp__bg"></div>
119
+    <!-- Slides wrapper with overflow:hidden. -->
120
+    <div class="pswp__scroll-wrap">
121
+        <!-- Container that holds slides.
122
+            PhotoSwipe keeps only 3 of them in the DOM to save memory.
123
+            Don't modify these 3 pswp__item elements, data is added later on. -->
124
+        <div class="pswp__container">
125
+            <div class="pswp__item"></div>
126
+            <div class="pswp__item"></div>
127
+            <div class="pswp__item"></div>
128
+        </div>
129
+        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
130
+        <div class="pswp__ui pswp__ui--hidden">
131
+            <div class="pswp__top-bar">
132
+                <!--  Controls are self-explanatory. Order can be changed. -->
133
+                <div class="pswp__counter"></div>
134
+                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
135
+                <button class="pswp__button pswp__button--share" title="Share"></button>
136
+                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
137
+                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
138
+                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
139
+                <!-- element will get class pswp__preloader--active when preloader is running -->
140
+                <div class="pswp__preloader">
141
+                    <div class="pswp__preloader__icn">
142
+                        <div class="pswp__preloader__cut">
143
+                            <div class="pswp__preloader__donut"></div>
144
+                        </div>
145
+                    </div>
146
+                </div>
147
+            </div>
148
+            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
149
+                <div class="pswp__share-tooltip"></div>
150
+            </div>
151
+            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
152
+            </button>
153
+            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
154
+            </button>
155
+            <div class="pswp__caption">
156
+                <div class="pswp__caption__center"></div>
157
+            </div>
158
+        </div>
159
+    </div>
160
+</div>
161
+
162
+<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
163
+<script src="//cdn.bootcss.com/photoswipe/4.1.2/photoswipe.min.js"></script>
164
+<script src="//cdn.bootcss.com/photoswipe/4.1.2/photoswipe-ui-default.min.js"></script>
165
+<script>
166
+    $(function () {
167
+        /** 格式化输入字符串 **/
168
+        // 用法: "hello{0}".format('world');返回'hello world'
169
+        String.prototype.format = function () {
170
+            var args = arguments;
171
+            return this.replace(/\{(\d+)\}/g, function (s, i) {
172
+                return args[i];
173
+            });
174
+        }
175
+
176
+        function fromNow(UTCDateString) {
177
+            var SECONDS_INTERVAL = 60;
178
+            var MINUTES_INTERVAL = SECONDS_INTERVAL * 60;
179
+            var HOURS_INTERVAL = MINUTES_INTERVAL * 24;
180
+            var DAYS_INTERVAL = HOURS_INTERVAL * 31;
181
+            var MONTHS_INTERVAL = DAYS_INTERVAL * 12;
182
+            var SECONDS_SUFFIX = "秒前";
183
+            var MINUTES_SUFFIX = "分钟前";
184
+            var HOURS_SUFFIX = "小时前";
185
+            var DAYS_SUFFIX = "天前";
186
+            var MONTHS_SUFFIX = "月前";
187
+            var YEARS_SUFFIX = "年前";
188
+            var second = new Date(Date.parse(UTCDateString)).getTime() / 1000;
189
+            var curSecond = new Date().getTime() / 1000;
190
+            var distance = curSecond - second;
191
+            var result = "";
192
+            if (distance <= 0) {
193
+                result = UTCDateString;
194
+            } else if (distance < SECONDS_INTERVAL) {
195
+                result = Math.ceil(distance) + SECONDS_SUFFIX;
196
+            } else if (distance < MINUTES_INTERVAL) {
197
+                var count = distance / SECONDS_INTERVAL;
198
+                result = Math.ceil(count) + MINUTES_SUFFIX;
199
+            } else if (distance < HOURS_INTERVAL) {
200
+                var count = distance / MINUTES_INTERVAL;
201
+                count = Math.floor(count) || 1;
202
+                result = count + HOURS_SUFFIX;
203
+            } else if (distance < DAYS_INTERVAL) {
204
+                var count = distance / HOURS_INTERVAL;
205
+                count = Math.floor(count) || 1;
206
+                result = count + DAYS_SUFFIX;
207
+            } else if (distance < MONTHS_INTERVAL) {
208
+                var count = distance / DAYS_INTERVAL;
209
+                count = Math.floor(count) || 1;
210
+                result = count + MONTHS_SUFFIX;
211
+            } else {
212
+                var count = distance / MONTHS_INTERVAL;
213
+                count = Math.floor(count) || 1;
214
+                result = count + YEARS_SUFFIX;
215
+            }
216
+            return result;
217
+        }
218
+
219
+        var GROUP_AVATAR_LIST = [
220
+            'apple',
221
+            'banana',
222
+            'broccoli',
223
+            'carambola',
224
+            'carrot',
225
+            'cherry',
226
+            'corn',
227
+            'dragon',
228
+            'eggplant',
229
+            'fig',
230
+            'grape',
231
+            'lemon',
232
+            'mangosteen',
233
+            'orange',
234
+            'papaya',
235
+            'peach',
236
+            'pineapple',
237
+            'strawberry',
238
+            'watermelon'
239
+        ]
240
+
241
+        var width = $(document).width();
242
+        var session_photos = {{ session_photos|safe }};
243
+        session_photos = [
244
+            {
245
+                "photos": [
246
+                    {
247
+                        "origin": 999,
248
+                        "photo_w": 1726,
249
+                        "longitude": 0,
250
+                        "location": "0.0",
251
+                        "origin_expired_stamps": 1534218632000,
252
+                        "photo_thumbnail2_w": 1080,
253
+                        "thumbup": false,
254
+                        "comment_num": 0,
255
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FirrP23RmLlLPX6tSFEsqnTmuKxS",
256
+                        "group_from": 0,
257
+                        "group_name": "文兰的木瓜群",
258
+                        "porder": {},
259
+                        "latitude": 0,
260
+                        "display_payment_btn": false,
261
+                        "group_default_avatar": 14,
262
+                        "user_id": "Q5ZYPEX",
263
+                        "nickname": "HQM",
264
+                        "photo_h": 1280,
265
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Fo__6zGVyL97919sHg3delWf02nE",
266
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FqPZkjQrkvO6Y3nlMDkLrb4o4yp-",
267
+                        "photo_id": "NKANPGPERBUbc6uTBqaeWB",
268
+                        "photo_share_url": "https://pai.ai/gp/NKANPGPERBUbc6uTBqaeWB",
269
+                        "created_at": "2018-08-07T11:50:32",
270
+                        "photo_thumbnail_h": 400,
271
+                        "session_id": null,
272
+                        "thumbup_num": 0,
273
+                        "photo_thumbnail_w": 540,
274
+                        "group_avatar": null,
275
+                        "photo_thumbnail2_h": 800,
276
+                        "nomark": 299,
277
+                        "photo_from": 0,
278
+                        "group_id": "T82d36P",
279
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epAYd6R93z0eXOEheGjw9O2CttNiakABXDkCpnmn28iaQ8qicmDjtbuibX95D63q0icVicY4JqDBa7DqpPg/132"
280
+                    },
281
+                    {
282
+                        "origin": 999,
283
+                        "photo_w": 1280,
284
+                        "longitude": 0,
285
+                        "location": "0.0",
286
+                        "origin_expired_stamps": 1533586498000,
287
+                        "photo_thumbnail2_w": 1080,
288
+                        "thumbup": false,
289
+                        "comment_num": 0,
290
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FuP6UDV-_tW7Y07zfdKP2o6k9_b5",
291
+                        "group_from": 1,
292
+                        "group_name": "1&2",
293
+                        "porder": {},
294
+                        "latitude": 0,
295
+                        "display_payment_btn": false,
296
+                        "group_default_avatar": 0,
297
+                        "user_id": "Q5ZYPEX",
298
+                        "nickname": "HQM",
299
+                        "photo_h": 1726,
300
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FtZzThTe0de5k8zvtl-HQtrGfodo",
301
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FjjakzlpiWEv4CxNNzBm2pDAs9jI",
302
+                        "photo_id": "iy2sv67BZy6S3ZsgZqceFG",
303
+                        "photo_share_url": "https://pai.ai/gp/iy2sv67BZy6S3ZsgZqceFG",
304
+                        "created_at": "2018-07-31T04:14:58",
305
+                        "photo_thumbnail_h": 728,
306
+                        "session_id": null,
307
+                        "thumbup_num": 0,
308
+                        "photo_thumbnail_w": 540,
309
+                        "group_avatar": "",
310
+                        "photo_thumbnail2_h": 1456,
311
+                        "nomark": 299,
312
+                        "photo_from": 0,
313
+                        "group_id": "KyJYjNq",
314
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epAYd6R93z0eXOEheGjw9O2CttNiakABXDkCpnmn28iaQ8qicmDjtbuibX95D63q0icVicY4JqDBa7DqpPg/132"
315
+                    },
316
+                    {
317
+                        "origin": 999,
318
+                        "photo_w": 1280,
319
+                        "longitude": 0,
320
+                        "location": "0.0",
321
+                        "origin_expired_stamps": 1533586479000,
322
+                        "photo_thumbnail2_w": 1080,
323
+                        "thumbup": false,
324
+                        "comment_num": 0,
325
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FmNXflMuFAH5TBBKo1Kdl-HfCjfm",
326
+                        "group_from": 1,
327
+                        "group_name": "1&2",
328
+                        "porder": {},
329
+                        "latitude": 0,
330
+                        "display_payment_btn": false,
331
+                        "group_default_avatar": 0,
332
+                        "user_id": "Q5ZYPEX",
333
+                        "nickname": "HQM",
334
+                        "photo_h": 1726,
335
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FmTWlIg0TI816RTHyd36v24dVI07",
336
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FliZRZxOjH9M5sRih0gtIprcRarm",
337
+                        "photo_id": "8U9YFNAtuGAcNRfhPDwNZn",
338
+                        "photo_share_url": "https://pai.ai/gp/8U9YFNAtuGAcNRfhPDwNZn",
339
+                        "created_at": "2018-07-31T04:14:39",
340
+                        "photo_thumbnail_h": 728,
341
+                        "session_id": null,
342
+                        "thumbup_num": 0,
343
+                        "photo_thumbnail_w": 540,
344
+                        "group_avatar": "",
345
+                        "photo_thumbnail2_h": 1456,
346
+                        "nomark": 299,
347
+                        "photo_from": 0,
348
+                        "group_id": "KyJYjNq",
349
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epAYd6R93z0eXOEheGjw9O2CttNiakABXDkCpnmn28iaQ8qicmDjtbuibX95D63q0icVicY4JqDBa7DqpPg/132"
350
+                    }
351
+                ],
352
+                "session_id": null
353
+            },
354
+            {
355
+                "photos": [
356
+                    {
357
+                        "origin": 999,
358
+                        "photo_w": 1920,
359
+                        "longitude": 0,
360
+                        "location": null,
361
+                        "origin_expired_stamps": 1529543079000,
362
+                        "photo_thumbnail2_w": 1080,
363
+                        "thumbup": true,
364
+                        "comment_num": 0,
365
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/Fm9RHWF-8-EyP-nW_sRrtm8hKUBh",
366
+                        "group_from": 1,
367
+                        "group_name": "solom",
368
+                        "porder": {},
369
+                        "latitude": 0,
370
+                        "display_payment_btn": false,
371
+                        "group_default_avatar": 0,
372
+                        "user_id": "LzWPe7z",
373
+                        "nickname": "solom",
374
+                        "photo_h": 1280,
375
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FrUHMvj2mUGGsqwcopoCEMXOscNC",
376
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FjzQm9ei98-jAHk4Q4FdgnZDhxIc",
377
+                        "photo_id": "tFuUQkkKsXUyV3N3g5ffFL",
378
+                        "photo_share_url": "https://pai.ai/gp/tFuUQkkKsXUyV3N3g5ffFL",
379
+                        "created_at": "2018-06-14T09:04:39",
380
+                        "photo_thumbnail_h": 360,
381
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
382
+                        "thumbup_num": 2,
383
+                        "photo_thumbnail_w": 540,
384
+                        "group_avatar": null,
385
+                        "photo_thumbnail2_h": 720,
386
+                        "nomark": 100,
387
+                        "photo_from": 1,
388
+                        "group_id": "WrWbvT7",
389
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
390
+                    },
391
+                    {
392
+                        "origin": 999,
393
+                        "photo_w": 1920,
394
+                        "longitude": 0,
395
+                        "location": null,
396
+                        "origin_expired_stamps": 1529542791000,
397
+                        "photo_thumbnail2_w": 1080,
398
+                        "thumbup": false,
399
+                        "comment_num": 0,
400
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FkA6op_9lT5fZx0F-rrYLGvPP2LK",
401
+                        "group_from": 1,
402
+                        "group_name": "solom",
403
+                        "porder": {},
404
+                        "latitude": 0,
405
+                        "display_payment_btn": false,
406
+                        "group_default_avatar": 0,
407
+                        "user_id": "LzWPe7z",
408
+                        "nickname": "solom",
409
+                        "photo_h": 1280,
410
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FtwypCr0xAn_JOP2OAb4SiEcMJkS",
411
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/Fk8TEji0jVQ7NEvcWzZYlrzTKDcl",
412
+                        "photo_id": "nWLmBhSa4QiEz72zw8LQBo",
413
+                        "photo_share_url": "https://pai.ai/gp/nWLmBhSa4QiEz72zw8LQBo",
414
+                        "created_at": "2018-06-14T08:59:51",
415
+                        "photo_thumbnail_h": 360,
416
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
417
+                        "thumbup_num": 1,
418
+                        "photo_thumbnail_w": 540,
419
+                        "group_avatar": null,
420
+                        "photo_thumbnail2_h": 720,
421
+                        "nomark": 100,
422
+                        "photo_from": 1,
423
+                        "group_id": "WrWbvT7",
424
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
425
+                    },
426
+                    {
427
+                        "origin": 999,
428
+                        "photo_w": 1920,
429
+                        "longitude": 0,
430
+                        "location": null,
431
+                        "origin_expired_stamps": 1529542510000,
432
+                        "photo_thumbnail2_w": 1080,
433
+                        "thumbup": false,
434
+                        "comment_num": 0,
435
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FgcUUsuqhfiYe-u4KOD0FNXQnsLC",
436
+                        "group_from": 1,
437
+                        "group_name": "solom",
438
+                        "porder": {},
439
+                        "latitude": 0,
440
+                        "display_payment_btn": false,
441
+                        "group_default_avatar": 0,
442
+                        "user_id": "LzWPe7z",
443
+                        "nickname": "solom",
444
+                        "photo_h": 1280,
445
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FrioUYlk1Q7cc_rbAu5UMiyQ98bA",
446
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/Fied2QXGIiJwK2IA8SDr4eHbUmH8",
447
+                        "photo_id": "nLbeNSqZk4Gxg6GDn9BSZT",
448
+                        "photo_share_url": "https://pai.ai/gp/nLbeNSqZk4Gxg6GDn9BSZT",
449
+                        "created_at": "2018-06-14T08:55:10",
450
+                        "photo_thumbnail_h": 360,
451
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
452
+                        "thumbup_num": 0,
453
+                        "photo_thumbnail_w": 540,
454
+                        "group_avatar": null,
455
+                        "photo_thumbnail2_h": 720,
456
+                        "nomark": 100,
457
+                        "photo_from": 1,
458
+                        "group_id": "WrWbvT7",
459
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
460
+                    },
461
+                    {
462
+                        "origin": 999,
463
+                        "photo_w": 1920,
464
+                        "longitude": 0,
465
+                        "location": null,
466
+                        "origin_expired_stamps": 1529542386000,
467
+                        "photo_thumbnail2_w": 1080,
468
+                        "thumbup": false,
469
+                        "comment_num": 0,
470
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FuPu9Vc9RqwrkSTUfw2PnDXr5QMy",
471
+                        "group_from": 1,
472
+                        "group_name": "solom",
473
+                        "porder": {},
474
+                        "latitude": 0,
475
+                        "display_payment_btn": false,
476
+                        "group_default_avatar": 0,
477
+                        "user_id": "LzWPe7z",
478
+                        "nickname": "solom",
479
+                        "photo_h": 1280,
480
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FmuVCUMJo4coOEq4NHEBBeFmQb8O",
481
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FrstI7EHRB8TQI4wqdZitOxrs2u4",
482
+                        "photo_id": "kEExAJr2WFtCfMYEZ4RQs9",
483
+                        "photo_share_url": "https://pai.ai/gp/kEExAJr2WFtCfMYEZ4RQs9",
484
+                        "created_at": "2018-06-14T08:53:06",
485
+                        "photo_thumbnail_h": 360,
486
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
487
+                        "thumbup_num": 0,
488
+                        "photo_thumbnail_w": 540,
489
+                        "group_avatar": null,
490
+                        "photo_thumbnail2_h": 720,
491
+                        "nomark": 100,
492
+                        "photo_from": 1,
493
+                        "group_id": "WrWbvT7",
494
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
495
+                    },
496
+                    {
497
+                        "origin": 999,
498
+                        "photo_w": 1920,
499
+                        "longitude": 0,
500
+                        "location": null,
501
+                        "origin_expired_stamps": 1529542315000,
502
+                        "photo_thumbnail2_w": 1080,
503
+                        "thumbup": false,
504
+                        "comment_num": 0,
505
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FrKF2be6dWIYV1ywLUjrm38AlYlV",
506
+                        "group_from": 1,
507
+                        "group_name": "solom",
508
+                        "porder": {},
509
+                        "latitude": 0,
510
+                        "display_payment_btn": false,
511
+                        "group_default_avatar": 0,
512
+                        "user_id": "LzWPe7z",
513
+                        "nickname": "solom",
514
+                        "photo_h": 1280,
515
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Fl6iCiax-ic2k3pKnTI2QU-gGnBl",
516
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/Fj_wavr-Lm46KH2XT5oWUxr3lyDW",
517
+                        "photo_id": "fM6RpikNzgwPmK2pT8nS4i",
518
+                        "photo_share_url": "https://pai.ai/gp/fM6RpikNzgwPmK2pT8nS4i",
519
+                        "created_at": "2018-06-14T08:51:55",
520
+                        "photo_thumbnail_h": 360,
521
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
522
+                        "thumbup_num": 0,
523
+                        "photo_thumbnail_w": 540,
524
+                        "group_avatar": null,
525
+                        "photo_thumbnail2_h": 720,
526
+                        "nomark": 100,
527
+                        "photo_from": 1,
528
+                        "group_id": "WrWbvT7",
529
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
530
+                    },
531
+                    {
532
+                        "origin": 999,
533
+                        "photo_w": 1920,
534
+                        "longitude": 0,
535
+                        "location": null,
536
+                        "origin_expired_stamps": 1529542304000,
537
+                        "photo_thumbnail2_w": 1080,
538
+                        "thumbup": false,
539
+                        "comment_num": 0,
540
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FucZ2YnjXE_A07ZAjGcyUvJyKloL",
541
+                        "group_from": 1,
542
+                        "group_name": "solom",
543
+                        "porder": {},
544
+                        "latitude": 0,
545
+                        "display_payment_btn": false,
546
+                        "group_default_avatar": 0,
547
+                        "user_id": "LzWPe7z",
548
+                        "nickname": "solom",
549
+                        "photo_h": 1280,
550
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FiNd32Wj2lpFrIYEDEHlVa7YKrJj",
551
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/Fs5NVvtVtAngySth_nlMTfFKX1Eg",
552
+                        "photo_id": "gn3TRYS8doVHFbvYgNPciE",
553
+                        "photo_share_url": "https://pai.ai/gp/gn3TRYS8doVHFbvYgNPciE",
554
+                        "created_at": "2018-06-14T08:51:44",
555
+                        "photo_thumbnail_h": 360,
556
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
557
+                        "thumbup_num": 0,
558
+                        "photo_thumbnail_w": 540,
559
+                        "group_avatar": null,
560
+                        "photo_thumbnail2_h": 720,
561
+                        "nomark": 100,
562
+                        "photo_from": 1,
563
+                        "group_id": "WrWbvT7",
564
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
565
+                    },
566
+                    {
567
+                        "origin": 999,
568
+                        "photo_w": 1920,
569
+                        "longitude": 0,
570
+                        "location": null,
571
+                        "origin_expired_stamps": 1529542169000,
572
+                        "photo_thumbnail2_w": 1080,
573
+                        "thumbup": false,
574
+                        "comment_num": 0,
575
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FottABOlrXvvKz6l7TwS9HlVN8zw",
576
+                        "group_from": 1,
577
+                        "group_name": "solom",
578
+                        "porder": {},
579
+                        "latitude": 0,
580
+                        "display_payment_btn": false,
581
+                        "group_default_avatar": 0,
582
+                        "user_id": "LzWPe7z",
583
+                        "nickname": "solom",
584
+                        "photo_h": 1280,
585
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Fsn-wgwwBXxBwSZlhynaO9uxQ-x8",
586
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/Fl16o1E6seH74IVYyhFC1Em1W4wi",
587
+                        "photo_id": "H9gRya2YjFsBSJPojCnceF",
588
+                        "photo_share_url": "https://pai.ai/gp/H9gRya2YjFsBSJPojCnceF",
589
+                        "created_at": "2018-06-14T08:49:29",
590
+                        "photo_thumbnail_h": 360,
591
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
592
+                        "thumbup_num": 0,
593
+                        "photo_thumbnail_w": 540,
594
+                        "group_avatar": null,
595
+                        "photo_thumbnail2_h": 720,
596
+                        "nomark": 100,
597
+                        "photo_from": 1,
598
+                        "group_id": "WrWbvT7",
599
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
600
+                    },
601
+                    {
602
+                        "origin": 999,
603
+                        "photo_w": 1920,
604
+                        "longitude": 0,
605
+                        "location": null,
606
+                        "origin_expired_stamps": 1529542126000,
607
+                        "photo_thumbnail2_w": 1080,
608
+                        "thumbup": false,
609
+                        "comment_num": 0,
610
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FsSZChEDy6cne8nYOwrUEGkp77h1",
611
+                        "group_from": 1,
612
+                        "group_name": "solom",
613
+                        "porder": {},
614
+                        "latitude": 0,
615
+                        "display_payment_btn": false,
616
+                        "group_default_avatar": 0,
617
+                        "user_id": "LzWPe7z",
618
+                        "nickname": "solom",
619
+                        "photo_h": 1280,
620
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FjgThdeAu0lLT574WTy3TWF_kjIX",
621
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/Fj4tDNdC4eoADKmjXsyCC0vSv9IP",
622
+                        "photo_id": "pvqickeguMC6YnLAQF7jAg",
623
+                        "photo_share_url": "https://pai.ai/gp/pvqickeguMC6YnLAQF7jAg",
624
+                        "created_at": "2018-06-14T08:48:46",
625
+                        "photo_thumbnail_h": 360,
626
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
627
+                        "thumbup_num": 0,
628
+                        "photo_thumbnail_w": 540,
629
+                        "group_avatar": null,
630
+                        "photo_thumbnail2_h": 720,
631
+                        "nomark": 100,
632
+                        "photo_from": 1,
633
+                        "group_id": "WrWbvT7",
634
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
635
+                    },
636
+                    {
637
+                        "origin": 999,
638
+                        "photo_w": 1920,
639
+                        "longitude": 0,
640
+                        "location": null,
641
+                        "origin_expired_stamps": 1529542117000,
642
+                        "photo_thumbnail2_w": 1080,
643
+                        "thumbup": false,
644
+                        "comment_num": 0,
645
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FlfefOVDBpuYTj5itjnr9SsfpVG4",
646
+                        "group_from": 1,
647
+                        "group_name": "solom",
648
+                        "porder": {},
649
+                        "latitude": 0,
650
+                        "display_payment_btn": false,
651
+                        "group_default_avatar": 0,
652
+                        "user_id": "LzWPe7z",
653
+                        "nickname": "solom",
654
+                        "photo_h": 1280,
655
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Ft_n52KgH3ehzOBT_ZMomxSusF_I",
656
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FqIN2abgIGTlP_BShUdAyfHmTPM5",
657
+                        "photo_id": "WbdCu3wArK6eHEwjcGPgQa",
658
+                        "photo_share_url": "https://pai.ai/gp/WbdCu3wArK6eHEwjcGPgQa",
659
+                        "created_at": "2018-06-14T08:48:37",
660
+                        "photo_thumbnail_h": 360,
661
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
662
+                        "thumbup_num": 0,
663
+                        "photo_thumbnail_w": 540,
664
+                        "group_avatar": null,
665
+                        "photo_thumbnail2_h": 720,
666
+                        "nomark": 100,
667
+                        "photo_from": 1,
668
+                        "group_id": "WrWbvT7",
669
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
670
+                    },
671
+                    {
672
+                        "origin": 999,
673
+                        "photo_w": 1920,
674
+                        "longitude": 0,
675
+                        "location": null,
676
+                        "origin_expired_stamps": 1529542106000,
677
+                        "photo_thumbnail2_w": 1080,
678
+                        "thumbup": false,
679
+                        "comment_num": 0,
680
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/Fg8aTnEMko3f55hZMTLCeyFB1IBg",
681
+                        "group_from": 1,
682
+                        "group_name": "solom",
683
+                        "porder": {},
684
+                        "latitude": 0,
685
+                        "display_payment_btn": false,
686
+                        "group_default_avatar": 0,
687
+                        "user_id": "LzWPe7z",
688
+                        "nickname": "solom",
689
+                        "photo_h": 1280,
690
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Fh5mHSYeYynspmMtXIQAprWy0ODn",
691
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FmPAYkJ-HsQXRdAlkpzC9RY4VRm_",
692
+                        "photo_id": "nHi5bKKbRuLWRBxkQcC35M",
693
+                        "photo_share_url": "https://pai.ai/gp/nHi5bKKbRuLWRBxkQcC35M",
694
+                        "created_at": "2018-06-14T08:48:26",
695
+                        "photo_thumbnail_h": 360,
696
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
697
+                        "thumbup_num": 0,
698
+                        "photo_thumbnail_w": 540,
699
+                        "group_avatar": null,
700
+                        "photo_thumbnail2_h": 720,
701
+                        "nomark": 100,
702
+                        "photo_from": 1,
703
+                        "group_id": "WrWbvT7",
704
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
705
+                    },
706
+                    {
707
+                        "origin": 999,
708
+                        "photo_w": 1920,
709
+                        "longitude": 0,
710
+                        "location": null,
711
+                        "origin_expired_stamps": 1529541824000,
712
+                        "photo_thumbnail2_w": 1080,
713
+                        "thumbup": false,
714
+                        "comment_num": 0,
715
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FiM2QV0kcQbwqKckpD9JkJ1Scddc",
716
+                        "group_from": 1,
717
+                        "group_name": "solom",
718
+                        "porder": {},
719
+                        "latitude": 0,
720
+                        "display_payment_btn": false,
721
+                        "group_default_avatar": 0,
722
+                        "user_id": "LzWPe7z",
723
+                        "nickname": "solom",
724
+                        "photo_h": 1280,
725
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FgS1spVS61DZdfPzWxTQO4Vs1Z2N",
726
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FvfJdhfljWkWfgq7TV2eHUTtVkp-",
727
+                        "photo_id": "cVUQwhndevCva4LXdMUVpd",
728
+                        "photo_share_url": "https://pai.ai/gp/cVUQwhndevCva4LXdMUVpd",
729
+                        "created_at": "2018-06-14T08:43:44",
730
+                        "photo_thumbnail_h": 360,
731
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
732
+                        "thumbup_num": 0,
733
+                        "photo_thumbnail_w": 540,
734
+                        "group_avatar": null,
735
+                        "photo_thumbnail2_h": 720,
736
+                        "nomark": 100,
737
+                        "photo_from": 1,
738
+                        "group_id": "WrWbvT7",
739
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
740
+                    },
741
+                    {
742
+                        "origin": 999,
743
+                        "photo_w": 1920,
744
+                        "longitude": 0,
745
+                        "location": null,
746
+                        "origin_expired_stamps": 1529541404000,
747
+                        "photo_thumbnail2_w": 1080,
748
+                        "thumbup": false,
749
+                        "comment_num": 0,
750
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FgajMVwPstn6iO8hQjEdt79uTsS3",
751
+                        "group_from": 1,
752
+                        "group_name": "solom",
753
+                        "porder": {},
754
+                        "latitude": 0,
755
+                        "display_payment_btn": false,
756
+                        "group_default_avatar": 0,
757
+                        "user_id": "LzWPe7z",
758
+                        "nickname": "solom",
759
+                        "photo_h": 1280,
760
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Fufz7LyavCFHdymqZb8SnJMWKZ67",
761
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FsEV99H3ZVVPUsnYYMiqHpejfTcC",
762
+                        "photo_id": "Kx4DVTpuxqynZQypFKFBhW",
763
+                        "photo_share_url": "https://pai.ai/gp/Kx4DVTpuxqynZQypFKFBhW",
764
+                        "created_at": "2018-06-14T08:36:44",
765
+                        "photo_thumbnail_h": 360,
766
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
767
+                        "thumbup_num": 0,
768
+                        "photo_thumbnail_w": 540,
769
+                        "group_avatar": null,
770
+                        "photo_thumbnail2_h": 720,
771
+                        "nomark": 100,
772
+                        "photo_from": 1,
773
+                        "group_id": "WrWbvT7",
774
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
775
+                    },
776
+                    {
777
+                        "origin": 999,
778
+                        "photo_w": 1920,
779
+                        "longitude": 0,
780
+                        "location": null,
781
+                        "origin_expired_stamps": 1529541154000,
782
+                        "photo_thumbnail2_w": 1080,
783
+                        "thumbup": false,
784
+                        "comment_num": 0,
785
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FnWJKneOOXCZ4QpTuzsL2f3aY-R5",
786
+                        "group_from": 1,
787
+                        "group_name": "solom",
788
+                        "porder": {},
789
+                        "latitude": 0,
790
+                        "display_payment_btn": false,
791
+                        "group_default_avatar": 0,
792
+                        "user_id": "LzWPe7z",
793
+                        "nickname": "solom",
794
+                        "photo_h": 1280,
795
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FlSlMaB9WcGi_jq6qOyfokXpjdx7",
796
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FuT97fRCofT0M48mXr1OM5xV8Sag",
797
+                        "photo_id": "itTfzb6hZWd8Up9xkdmCk2",
798
+                        "photo_share_url": "https://pai.ai/gp/itTfzb6hZWd8Up9xkdmCk2",
799
+                        "created_at": "2018-06-14T08:32:34",
800
+                        "photo_thumbnail_h": 360,
801
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
802
+                        "thumbup_num": 0,
803
+                        "photo_thumbnail_w": 540,
804
+                        "group_avatar": null,
805
+                        "photo_thumbnail2_h": 720,
806
+                        "nomark": 100,
807
+                        "photo_from": 1,
808
+                        "group_id": "WrWbvT7",
809
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
810
+                    },
811
+                    {
812
+                        "origin": 999,
813
+                        "photo_w": 1920,
814
+                        "longitude": 0,
815
+                        "location": null,
816
+                        "origin_expired_stamps": 1529541118000,
817
+                        "photo_thumbnail2_w": 1080,
818
+                        "thumbup": false,
819
+                        "comment_num": 0,
820
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FhfQyF1TywtriSCNxF-_dAYhPz-W",
821
+                        "group_from": 1,
822
+                        "group_name": "solom",
823
+                        "porder": {},
824
+                        "latitude": 0,
825
+                        "display_payment_btn": false,
826
+                        "group_default_avatar": 0,
827
+                        "user_id": "LzWPe7z",
828
+                        "nickname": "solom",
829
+                        "photo_h": 1280,
830
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FrIkVp2aa8-mIxJsKmGme5iU_J1v",
831
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FpjEqxgAWtJcITMR9xPpxd0WCOpf",
832
+                        "photo_id": "2qeTqWuHrNHwLUYFvx8XEX",
833
+                        "photo_share_url": "https://pai.ai/gp/2qeTqWuHrNHwLUYFvx8XEX",
834
+                        "created_at": "2018-06-14T08:31:58",
835
+                        "photo_thumbnail_h": 360,
836
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
837
+                        "thumbup_num": 0,
838
+                        "photo_thumbnail_w": 540,
839
+                        "group_avatar": null,
840
+                        "photo_thumbnail2_h": 720,
841
+                        "nomark": 100,
842
+                        "photo_from": 1,
843
+                        "group_id": "WrWbvT7",
844
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
845
+                    },
846
+                    {
847
+                        "origin": 999,
848
+                        "photo_w": 1920,
849
+                        "longitude": 0,
850
+                        "location": null,
851
+                        "origin_expired_stamps": 1529541095000,
852
+                        "photo_thumbnail2_w": 1080,
853
+                        "thumbup": false,
854
+                        "comment_num": 0,
855
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FqiGM9ZY9RR0wApMtVXqMNhpHYuW",
856
+                        "group_from": 1,
857
+                        "group_name": "solom",
858
+                        "porder": {},
859
+                        "latitude": 0,
860
+                        "display_payment_btn": false,
861
+                        "group_default_avatar": 0,
862
+                        "user_id": "LzWPe7z",
863
+                        "nickname": "solom",
864
+                        "photo_h": 1280,
865
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FliQ3QCt_69YViub4mGCahmjDM-_",
866
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FvXB-V4UAfVqoTds827EzoNKK-yl",
867
+                        "photo_id": "JtpKcN4LLE84CsVE2tFJQ2",
868
+                        "photo_share_url": "https://pai.ai/gp/JtpKcN4LLE84CsVE2tFJQ2",
869
+                        "created_at": "2018-06-14T08:31:35",
870
+                        "photo_thumbnail_h": 360,
871
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
872
+                        "thumbup_num": 0,
873
+                        "photo_thumbnail_w": 540,
874
+                        "group_avatar": null,
875
+                        "photo_thumbnail2_h": 720,
876
+                        "nomark": 100,
877
+                        "photo_from": 1,
878
+                        "group_id": "WrWbvT7",
879
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
880
+                    },
881
+                    {
882
+                        "origin": 999,
883
+                        "photo_w": 1920,
884
+                        "longitude": 0,
885
+                        "location": null,
886
+                        "origin_expired_stamps": 1529541063000,
887
+                        "photo_thumbnail2_w": 1080,
888
+                        "thumbup": false,
889
+                        "comment_num": 0,
890
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FqV3ngD73YRBna0UbNerv9Y5HLHC",
891
+                        "group_from": 1,
892
+                        "group_name": "solom",
893
+                        "porder": {},
894
+                        "latitude": 0,
895
+                        "display_payment_btn": false,
896
+                        "group_default_avatar": 0,
897
+                        "user_id": "LzWPe7z",
898
+                        "nickname": "solom",
899
+                        "photo_h": 1280,
900
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/FkOtpDM2UoqYRX-_jZRIb2IclXwk",
901
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FtWErvFBRn5ivcecXNTnT2UBtLRv",
902
+                        "photo_id": "9GFXKSy3YNc2rY5ZAF8Thc",
903
+                        "photo_share_url": "https://pai.ai/gp/9GFXKSy3YNc2rY5ZAF8Thc",
904
+                        "created_at": "2018-06-14T08:31:03",
905
+                        "photo_thumbnail_h": 360,
906
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
907
+                        "thumbup_num": 0,
908
+                        "photo_thumbnail_w": 540,
909
+                        "group_avatar": null,
910
+                        "photo_thumbnail2_h": 720,
911
+                        "nomark": 100,
912
+                        "photo_from": 1,
913
+                        "group_id": "WrWbvT7",
914
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
915
+                    },
916
+                    {
917
+                        "origin": 999,
918
+                        "photo_w": 1920,
919
+                        "longitude": 0,
920
+                        "location": null,
921
+                        "origin_expired_stamps": 1529540593000,
922
+                        "photo_thumbnail2_w": 1080,
923
+                        "thumbup": false,
924
+                        "comment_num": 0,
925
+                        "photo_thumbnail_url": "http://orf3ahvt6.bkt.clouddn.com/FrhawRT3wVCiKWl2OqhoUsaKeAYG",
926
+                        "group_from": 1,
927
+                        "group_name": "solom",
928
+                        "porder": {},
929
+                        "latitude": 0,
930
+                        "display_payment_btn": false,
931
+                        "group_default_avatar": 0,
932
+                        "user_id": "LzWPe7z",
933
+                        "nickname": "solom",
934
+                        "photo_h": 1280,
935
+                        "photo_url": "http://orf3lnlmb.bkt.clouddn.com/Fsox2chS8bu5VmoUSgb-n1Br-0no",
936
+                        "photo_thumbnail2_url": "http://orf3muf5n.bkt.clouddn.com/FlxLpjSCteQVtSBuRt_406Cn_0Tz",
937
+                        "photo_id": "MuZ3vUUskdnC9P454xuaGf",
938
+                        "photo_share_url": "https://pai.ai/gp/MuZ3vUUskdnC9P454xuaGf",
939
+                        "created_at": "2018-06-14T08:23:13",
940
+                        "photo_thumbnail_h": 360,
941
+                        "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz",
942
+                        "thumbup_num": 0,
943
+                        "photo_thumbnail_w": 540,
944
+                        "group_avatar": null,
945
+                        "photo_thumbnail2_h": 720,
946
+                        "nomark": 100,
947
+                        "photo_from": 1,
948
+                        "group_id": "WrWbvT7",
949
+                        "avatar": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erxcJiaabkvdFnmb7LTsjwBKlwLGIxCsxx7OwZQYGDkVexcshb0SSDQaF6pcQLqWrbPad9EFqbDM6Q/132"
950
+                    }
951
+                ],
952
+                "session_id": "LzWPe7z6v46522px527gb9fcaqb8abiz"
953
+            }
954
+        ]
955
+        var photoWidth = width * 49 / 100;
956
+        var photoHeight = 0;
957
+        var photoIdx = 0;
958
+        var leftHeight = 0;
959
+        var rightHeight = 0;
960
+        var leftImgs = '';
961
+        var rightImgs = '';
962
+        var swipeItems = [];
963
+
964
+        for (var i = 0; i < session_photos.length; i++) {
965
+            var photos = session_photos[i].photos;
966
+            for (var j = 0; j < photos.length; j++) {
967
+                photoHeight = photos[j].photo_thumbnail_h / photos[j].photo_thumbnail_w * photoWidth;
968
+                var header = (
969
+                    '<div class="photo-top">' +
970
+                        '<img class="group-avatar float-left" src="../../static/img/{0}.png" />' +
971
+                        '<text class="group-name float-left">{1}</text>' +
972
+                        '<text class="section-text float-right">{2}</text>' +
973
+                    '</div>'
974
+                ).format(GROUP_AVATAR_LIST[photos[j].group_default_avatar], photos[j].group_name, fromNow(photos[j].created_at));
975
+                var imgctx = '<img src="{0}" data-idx="{1}" style="width:{2}px;height:{3}px">'.format(photos[j].photo_thumbnail_url, photoIdx, photoWidth, photoHeight);
976
+                var footer = (
977
+                    '<div class="photo-bottom">' +
978
+                        '<img class="section-icon float-left" src="../../static/img/thumbup.png" />' +
979
+                        '<text class="thump-comment-num float-left">{0}</text>' +
980
+                        '<img class="section-icon float-left" src="../../static/img/comment.png" />' +
981
+                        '<text class="thump-comment-num float-left">{1}</text>' +
982
+                    '</div>'
983
+                ).format(photos[j].thumbup_num, photos[j].comment_num);
984
+                if (leftHeight > rightHeight) {
985
+                    rightHeight += photoHeight + 72;
986
+                    rightImgs += '<div class="imgctx">{0}{1}{2}</div>'.format(header, imgctx, footer);
987
+                } else {
988
+                    leftHeight += photoHeight + 72;
989
+                    leftImgs += '<div class="imgctx">{0}{1}{2}</div>'.format(header, imgctx, footer);
990
+                }
991
+                swipeItems.push({
992
+                    src: photos[j].photo_url,
993
+                    w: photos[j].photo_w,
994
+                    h: photos[j].photo_h,
995
+                })
996
+                photoIdx += 1;
997
+            }
998
+        }
999
+
1000
+        $('#left').append(leftImgs);
1001
+        $('#right').append(rightImgs);
1002
+
1003
+        var pswpElement = document.querySelectorAll('.pswp')[0];
1004
+        // define options (if needed)
1005
+        var options = {
1006
+            // optionName: 'option value'
1007
+            // for example:
1008
+            loop: true,
1009
+            index: 1, // start at first slide
1010
+            // Tap on sliding area should close gallery'
1011
+            tapToClose: true,
1012
+        };
1013
+        // Initializes and opens PhotoSwipe
1014
+        $('#photos img').click(function () {
1015
+            options['index'] = parseInt($(this).attr('data-idx'));
1016
+            var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, swipeItems, options);
1017
+            gallery.init();
1018
+
1019
+            $('#mask-thump').show();
1020
+
1021
+            // After slides change
1022
+            // (after content changed)
1023
+            gallery.listen('afterChange', function() {
1024
+                console.log(gallery.getCurrentIndex())
1025
+            });
1026
+
1027
+            // Gallery starts closing
1028
+            gallery.listen('close', function() {
1029
+                $('#mask-thump').hide();
1030
+            });
1031
+        })
1032
+    })
1033
+</script>
1034
+<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
1035
+<script type="text/javascript" src="{% static 'pai2/js/jswe-0.0.4.js' %}"></script>
1036
+<script>
1037
+    V.initWxData({
1038
+        imgUrl: "http://pai.ai/static/pai2/img/paiai_96_96.png",
1039
+        link: 'http://pai.ai/w/o?r=http%3A%2F%2Fpai.ai%2Fp%2Floginqr',
1040
+        desc: "授权登录",
1041
+        title: "授权登录",
1042
+        timeLine: ""
1043
+    }, true);
1044
+    V.hideOptionMenu();
1045
+</script>
1046
+</body>
1047
+</html>

+ 1 - 0
page/urls.py

@@ -33,4 +33,5 @@ urlpatterns += [
33 33
 # 小程序相关
34 34
 urlpatterns += [
35 35
     url(r'^mini$', mini_views.mini_preview, name='mini_preview'),  #
36
+    url(r'^mini2$', mini_views.mini_preview2, name='mini_preview2'),  #
36 37
 ]

+ 1 - 1
pai2/urls.py

@@ -86,7 +86,7 @@ urlpatterns += [
86 86
     url(r'^uniapi/', include('django_uniapi.urls', namespace='uniapi')),
87 87
     url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
88 88
 
89
-    url(r'^p/', include('page.urls', namespace='shortpage')),
89
+    # url(r'^p/', include('page.urls', namespace='shortpage')),
90 90
     url(r'^page/', include('page.urls', namespace='page')),
91 91
 
92 92
     url(r'^w/', include('django_we.urls', namespace='shortwechat')),

+ 2 - 1
requirements_dj.txt

@@ -11,11 +11,12 @@ django-mobi2==1.0.2
11 11
 django-models-ext==1.1.6
12 12
 django-multidomain==1.1.4
13 13
 django-paginator2==1.0.4
14
+django-query==1.0.3
14 15
 django-redis-connector==1.0.1
15 16
 django-response==1.1.1
16 17
 django-rlog==1.0.7
17 18
 django-shortuuidfield==0.1.3
18 19
 django-six==1.0.4
19
-django-uniapi==1.0.4
20
+django-uniapi==1.0.5
20 21
 django-we==1.4.2
21 22
 djangorestframework==3.7.7

+ 2 - 2
requirements_pywe.txt

@@ -1,8 +1,8 @@
1 1
 pywe-jssdk==1.1.0
2 2
 pywe-membercard==1.0.0
3
-pywe-miniapp==1.0.2
3
+pywe-miniapp==1.1.0
4 4
 pywe-oauth==1.0.6
5
-pywe-pay==1.0.11
5
+pywe-pay==1.0.12
6 6
 pywe-pay-notify==1.0.4
7 7
 pywe-response==1.0.1
8 8
 pywe-sign==1.0.8

+ 77 - 0
utils/home_photo_utils.py

@@ -0,0 +1,77 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from __future__ import division
4
+
5
+import itertools
6
+
7
+from django.conf import settings
8
+from django.db import connection
9
+from django_query import get_query_value
10
+from paginator import pagination
11
+
12
+from group.models import GroupPhotoInfo
13
+from utils.qiniucdn import qiniu_file_url
14
+from utils.redis.rgroup import get_group_photo_thumbup_flag
15
+from utils.redis.rorder import get_lensman_order_record
16
+from utils.sql.raw import PAI2_HOME_API, PAI2_HOME_WX_API
17
+from utils.time_utils import origin_expired_stamps
18
+from utils.url_utils import share_url
19
+
20
+
21
+def get_home_photos(request):
22
+    user_id = get_query_value(request, 'user_id')
23
+    page = get_query_value(request, 'page', default=1, val_cast_func=int)
24
+    num = get_query_value(request, 'num', default=settings.PAI2_HOME_PER_PAGE, val_cast_func=int)
25
+
26
+    # 执行原生 SQL 语句,获取首页照片列表
27
+    cursor = connection.cursor()
28
+    cursor.execute((PAI2_HOME_WX_API if request.weixin else PAI2_HOME_API).format(
29
+        user_id=user_id,
30
+        offset=0,
31
+        rows=settings.PAI2_HOME_MAX_ROWS,
32
+    ))
33
+    rows = cursor.fetchall()
34
+
35
+    # 首页照片分页
36
+    rows, left = pagination(rows, page, num)
37
+
38
+    # 首页照片信息
39
+    rows = [{
40
+        'group_id': row[0],
41
+        'group_name': row[1],
42
+        'group_default_avatar': row[2],
43
+        'group_avatar': row[3],
44
+        'group_from': row[4],
45
+        'photo_id': row[5],
46
+        'photo_url': qiniu_file_url(row[6], bucket='watermark' if row[7] else 'photo'),
47
+        'photo_w': row[8],
48
+        'photo_h': row[9],
49
+        'photo_thumbnail_url': qiniu_file_url(row[10], bucket='thumbnail'),
50
+        'photo_thumbnail_w': row[11],
51
+        'photo_thumbnail_h': row[12],
52
+        'photo_thumbnail2_url': qiniu_file_url(row[13], bucket='thumbnail2'),
53
+        'photo_thumbnail2_w': row[14],
54
+        'photo_thumbnail2_h': row[15],
55
+        'photo_share_url': share_url(row[5]),  # Warning: Index of This Line is 5
56
+        'user_id': row[16],
57
+        'nickname': row[17],
58
+        'avatar': row[18],
59
+        'comment_num': row[19],
60
+        'thumbup_num': row[20],
61
+        'photo_from': row[21],
62
+        'session_id': row[22],
63
+        'nomark': row[23],
64
+        'origin': row[24],
65
+        'created_at': row[25],
66
+        'origin_expired_stamps': origin_expired_stamps(row[25], row[16]),
67
+        'thumbup': get_group_photo_thumbup_flag(row[5], user_id),
68
+        'porder': get_lensman_order_record(row[5], user_id) if row[21] == GroupPhotoInfo.SESSION_GROUP else {},
69
+        'display_payment_btn': row[21] == GroupPhotoInfo.SESSION_GROUP and row[27] not in [GroupPhotoInfo.OUTTAKE],
70
+        'longitude': row[28],
71
+        'latitude': row[29],
72
+        'location': row[30],
73
+    } for row in rows]
74
+
75
+    session_photos = map(lambda x: {'session_id': x[0], 'photos': list(x[1])}, itertools.groupby(rows, lambda x: x.get('session_id', '')))
76
+
77
+    return rows, session_photos, left